<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
				<!-- 引入样式 -->
				<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
				<!-- 引用Vue -->
				<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
				<!-- 引入组件库 -->
		
				<!-- 引入组件库 -->
				<script src="https://unpkg.com/element-ui/lib/index.js"></script>
						
		<title>新建销售机会的页面</title>
		<style>
			body {
    color: #333333;
    background-color: #FFFFFF;
    font-size: 12px;
    font-family: "Microsoft Yahei", 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
	.portlet .portlet-heading {
		border-radius: 3px 3px 0px 0px;
		background-clip: padding-box;
		color: #ffffff;
		padding: 12px 20px;
	}
	.f-s-12 {
		font-size: 12px !important;
	}	
	.pull-right{
		float: right!important;
	}
	.btn {
    padding: 8px 12px;
    color: initial;
}
	.btn-white{
	border: 1px solid #eaeaea !important;
    background-color: #ffffff;
	}
	.f-s-12 .btn {
    font-size: 12px !important;
}
	.modal-title {
    color: #000000 !important;
}   
	.modal-title {
    margin: 0;
    line-height: 1.42857143;
}
h1, h2, h3, h4, h5, h6 {
    color: #505458;
    font-family: "microsoft yahei","Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 10px 0;
}
.h4, h4 {
    font-size: 18px;
}
	.border-t-a {
    border-top: 1px solid #aaaaaa;
}
hr {
    margin-top: 24px;
    margin-bottom: 24px;
    border: 0;
}
.collapse.in {
    display: block;
}
.portlet .portlet-body {
    background: #ffffff;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    padding: 15px;
}
.p-r-7 {
    padding-right: 7% !important;
}

.p-t-0 {
    padding-top: 0px !important;
}
	.text-center-b:first-child {
    margin-top: 30px;
}
	.text-center-b {
		text-align: center;
		position: relative;
		margin: 30px 0px 15px;
		color: #000000;
		font-weight: bold;
}
	.text-center-b span {
    background: #ebeff2;
    padding: 0px 10px;
}
	.bg-white {
	    background-color: #ffffff !important;
	}
	.row {
    margin-right: -10px;
    margin-left: -10px;
}
	.col-md-6 {
    width: 50%;
	margin-left: 4%;
}
@media (min-width: 992px)
.col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9 {
    float: left;
}
.modal .form-group {
    margin-bottom: 10px;
}
.form-horizontal .form-group {
    margin-left: -10px;
    margin-right: -10px;
}
.modal .form-horizontal .control-label {
    margin-right: -15px;
}
.form-horizontal .control-label {
    font-size: 12px;
    font-weight: normal;
}
.form-horizontal .control-label {
    padding-top: 7px;
    margin-bottom: 0;
    text-align: right;
}
	.col-md-8 {
    width: 66.66666667%;
}
.text-primary {
    color: #5d9cec;
}
.modal .form-control {
    height: 30px;
}
.form-control{
    background-color: #FFFFFF;
    border: 1px solid #E3E3E3;
    border-radius: 4px;
    color: #565656;
    padding: 7px 12px;
    }
.aaa{
font-size: 12px;
    list-style: none;
    color: #f6504d;
}

		</style>
		
		<script type="text/javascript">
		
		$(function(){
			
		/* 	$("#lianxiren").click(function(){
				var kehuh= $('#kehuh option:selected').val();
				if(kehuh!=""){
					$(function(){
						  $.ajax({  
					            type: "POST",   //提交的方法
					            url:"selectcontact", //提交的地址  
					            data:{"tcid" : kehuh},
					            async: false,  
					            error: function(request) {  //失败的话
					                 alert("请将表单填写完整");  
					            },  
					            success: function(data) {  //成功
					            	//$(".info-center").load("/actionRecord/findByPage"); 
					            alert("成功");
					            }  
					         }); 
						}); 
				}
				
			}); */
			
				$("#baocun").click(function(){
					var demandtheme=$("input[name='demandtheme']").val();//需求主题
					var demandprovider=$("input[name='demandprovider']").val();//需求提供人
					var detaliid=$("input[name='id']").val();
					var customer=$("input[name='cid']").val();
					var correspondingopp= $('#correspondingopp option:selected').val();//机会
					var recordtime = $('#recordtime').val()//时间
					var importancedegree= $('#importancedegree option:selected').val();
					var demandcontent=$("input[name='demandcontent']").val();//需求主题
					if(demandtheme==""){
						$("#aaa").css("display","block");
					}else{
						$("#aaa").css("display","none");
					}
					if(demandtheme!=""){
						$(function(){
							      $.ajax({  
						            type: "get",   //提交的方法
						            url:"bianjixuqiu1", //提交的地址  
						            data:{"demandtheme" : demandtheme,"customer":customer,"correspondingopp":correspondingopp,"recordtime":recordtime,
						            	"importancedegree":importancedegree,"demandcontent":demandcontent,"demandprovider":demandprovider,"detaliid":detaliid},
						            async: false,  
						            error: function(request) {  //失败的话
						                 alert("请将表单填写完整");  
						            },  
						            success: function(data) {  //成功
						            	$('#main').load('xuqiu');
						            }  
						         });    
    
							
						
							
							}); 
					}
					
					});
			
		});
		</script>
		
	</head>
	<body>
		<div style="width:70%;height:860px;border:1px solid red;margin: 0 auto;margin-top: 40px;background: #ebeff2;" class="aa">
			<div class="portlet-heading portlet-default" style="padding: 12px 20px;">
				<div class="pull-right  f-s-12" >
					<button class="btn btn-white waves-effect waves-light" id="baocun" style="width: 79px;height: 45px;maergin-top:10px;margin-right: 15px;">
						<i class="el-icon-check"></i>
						<span style="font-size: 12px !important;">保存</span>
					</button>
				</div>
				<h4 class="modal-title text-dark">
					<span>客户需求</span>
				</h4>
				<hr class="border-t-a"/>
			</div>
			
			<div class="gedit_scroll_content">
				<div class="panel-collapse collapse in"> 
					<div class="portlet-body p-t-0 p-r-7 BODY_EDIT_SHOW_BOX">
					<div class="text-center-b">
						<i class="el-icon-minus"></i><i class="el-icon-minus"></i><i class="el-icon-minus"></i>
						<span class="bg-white">机会</span><i class="el-icon-minus"></i><i class="el-icon-minus"></i><i class="el-icon-minus"></i>
					</div>
					<div class="form-group no-margin" style="margin-left: 65px;">
								<label class="control-label col-md-4" style="float: left;height: 30px; line-height:30px ; ">
									<span style="color: #ff0000;font-size: 16px;">*</span>
									需求主题:
								</label>
								<div style="width: 650px;float: left;">
								<input class="form-control" value="${list.get(0).getDemandtheme()}" name="demandtheme" style="width:500px;height:35px;margin-left: 5px;"/>
								<input name="id" value="${list.get(0).getDetaliid()}" type="hidden">
								<li class="aaa" id="aaa" style="display: none">必填项</li>
								</div>
					</div>
					<div class="form-group no-margin" style="margin-left: 65px;margin-top: 10px;">
								<label class="control-label col-md-4" style="float: left;height: 30px; line-height:30px ;margin-top:10px; ">
									需求提供人:
								</label>
								<div style="width: 650px;float: left;">
								<input class="form-control" value="${list.get(0).getDemandprovider()}"  name="demandprovider" style="width:500px;height:25px;margin-left: 5px;margin-top:10px;"/>
								
								</div>
					</div>
							<div class="form-group no-margin" style="margin-left: 65px;margin-top: 10px;">
								<label class="control-label col-md-4" style="float: left;height: 30px; line-height:30px ;margin-top:10px; ">
									&nbsp;&nbsp;&nbsp;客户&nbsp;:
								</label>
								<div style="width: 350px;float: left;margin-top: 17px;margin-left: 10px;font-size: 16px;">
								${list.get(0).getCustomerBean().getCname()}
								<input name="cid" value="${list.get(0).getCustomerBean().getCid()}" type="hidden">
								
								</div>
					</div>
					
					<div class="form-group no-margin" style="margin-left: 65px;margin-top: 10px;">
								<label class="control-label col-md-4" style="float: left;height: 30px; line-height:30px ;margin-top:10px; ">
									&nbsp;&nbsp;&nbsp;对应机会&nbsp;:
								</label>
								<div style="width: 250px;float: left;">
								<select id="correspondingopp" style="width:250px;height:35px;margin-left: 10px;margin-top:10px;">
								<c:forEach  items="${jihuizhutu}" var="selectpass">
								<option value="${selectpass.salesid}" >${selectpass.salestheme}</option>
								</c:forEach>
								</select>
								
								</div>
					</div>
					
					<div class="form-group no-margin" style="margin-left: 65px;margin-top: 10px;">
								<label class="control-label col-md-4" style="float: left;height: 30px; line-height:30px ;margin-top:10px; ">
									记录时间:
								</label>
								<div style="width: 350px;float: left;">
								<%-- ${list.get(0).getRecordtime()} --%>
								<input value="2019-10-10"  id="recordtime" class="form-control" type="date" name="recordtime" style="width:200px;height:25px;margin-left: 5px;margin-top:10px;"/>
								
								</div>
					</div>
					<div class="form-group no-margin" style="margin-left: 65px;margin-top: 10px;">
								<label class="control-label col-md-4" style="float: left;height: 30px; line-height:30px ;margin-top:10px; ">
									重要程度:
								</label>
								<div style="width: 290px;float: left;">
									<select id="importancedegree" style="width:250px;height:35px;margin-left: 10px;margin-top:10px;">
								<option></option>
								<c:if test="${list.get(0).getImportancedegree()  eq 1}">
								<option value="1" selected="selected">非常重要</option>
								</c:if>
								<c:if test="${list.get(0).getImportancedegree() != 1}">
								<option value="1">非常重要</option>
								</c:if>
								<c:if test="${list.get(0).getImportancedegree()  eq 2}">
								<option value="2" selected="selected">重要</option>
								</c:if>
								<c:if test="${list.get(0).getImportancedegree() != 2}">
								<option value="2">重要</option>
								</c:if>
								
								<c:if test="${list.get(0).getImportancedegree()  eq 3}">
								<option value="3">一般</option>
								</c:if>
								<c:if test="${list.get(0).getImportancedegree() != 3}">
								<option value="3">一般</option>
								</c:if>
								<c:if test="${list.get(0).getImportancedegree()  eq 4}">
								<option value="4">不重要</option>
								</c:if>
								<c:if test="${list.get(0).getImportancedegree() != 4}">
								<option value="4">不重要</option>
								</c:if>
								
								
								</select>								
								</div>
					</div>
					<div class="form-group no-margin" style="margin-left: 65px;">
								
								<div style="width: 650px;float: left; margin-top: 20px;">
								<label class="control-label col-md-4" style="float: left;height: 30px; line-height:30px ; ">
									<span style="color: #ff0000;font-size: 16px;">*</span>
									需求内容:
								</label>
								<input value="${list.get(0).getDemandcontent() }" class="form-control" name="demandcontent" style="width:500px;height:60px;margin-left: 5px;"/>
								
								</div>
					</div>
					</div>
				</div>
			</div>
			
			
			
			
			
			
			
			
		</div>
			
		
	</body>
</html>
